package ro.gillardon.persistence;

import java.util.List;

import ro.gillardon.commons.enums.City;
import ro.gillardon.commons.enums.Hotel;
import ro.gillardon.commons.hotel.HotelConditions;
import ro.gillardon.commons.hotel.HotelDetailsWrapper;
import ro.gillardon.persistence.document.model.HotelDetails;
import ro.gillardon.persistence.exception.PersistenceException;

/**
 * Interface which specifies the possible methods which can be applied on a HotelDetails.
 *
 * @author haiurar
 */
public interface HotelDetailsDAO {

  /**
   * Saves the hotel details given as parameter in DB.
   *
   * @param hotelDetails details related to a hotel (roomType, dayType, price...)
   * @return the added hotelDetails
   * @throws PersistenceException in case of error
   */
  public HotelDetails save(HotelDetails hotelDetails) throws PersistenceException;

  /**
   * Saves the hotel details specific for each roomType and dayType extracted from hotelDetailsWrapper.
   *
   * @param hotelDetailsWrapper is a wrapper class for the prices of the different room types and day types for a hotel
   * @return the added hotelDetailsWrapper
   * @throws PersistenceException in case of error
   */

  public HotelDetailsWrapper save(HotelDetailsWrapper hotelDetailsWrapper) throws PersistenceException;

  /**
   * Gets the latest hotel offer for the specified hotel.
   *
   * @param hotel the hotel name
   * @return the offer for the specified hotel
   * @throws PersistenceException in case of error
   */

  public HotelDetailsWrapper getLatestHotelOffer(Hotel hotel) throws PersistenceException;

  /**
   * Gets the latest hotel offer for the given conditions.
   *
   * @param hotelConditions specific conditions for a specific hotel (roomType, dayType, hotel...)
   * @return the hotelDetails
   * @throws PersistenceException in case of error
   */

  public HotelDetails getLastHotelOffer(HotelConditions hotelCondition) throws PersistenceException;

  /**
   * Gets all hotels from a specific location.
   *
   * @param location the city
   * @return a list of hotels from the specified location
   * @throws PersistenceException in case of error
   */

  public List<Hotel> getAllHotelsFromLocation(City location) throws PersistenceException;

  /**
   * Gets all locations.
   *
   * @return a list of all locations
   * @throws PersistenceException in case of error
   */

  public List<City> getAllLocations() throws PersistenceException;
}
